package com.chaoli.reggie_diy.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chaoli.reggie_diy.common.R;
import com.chaoli.reggie_diy.domain.Orders;
import com.chaoli.reggie_diy.dto.OrdersDto;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

public interface OrderService extends IService<Orders> {

    /**
     * 用户下单
     * @param orders
     */
    @Transactional
    void submit(Orders orders);

    /**
     * 查看订单明细
     * @param page
     * @param pageSize
     * @param number
     * @param beginTime
     * @param endTime
     * @return
     */
    R<Page<Orders>> ordersPage(int page, int pageSize, String number, String beginTime, String endTime);


    /**
     * 用户订单分页明细
     * @param page
     * @param pageSize
     * @return
     */
    R<Page<OrdersDto>> userPage(int page, int pageSize);

    /**
     * 再来一单
     * @param map
     * @return
     */
    R<String> again(Map<String, String> map);
}
